import axios from "axios";
import store from "../store/index"

export function getFileTree() {
    return axios.get('/api/getFileTree', {headers:{
            "Authorization": store.state.token
        }})
}

export function addFileFolder(data) {
    return axios.post('/api/addFileFolder', data, {headers:{
            "Authorization": store.state.token
        }})
}

export function delFile(data) {
    return axios.post('/api/delFile', data, {headers:{
            "Authorization": store.state.token
        }})
}

export function parseFile(data) {
    return axios.post('/api/getFileContent', data, {headers:{
            "Authorization": store.state.token
        }})
}

export function uploadFile(data) {
    return axios.post('/api/uploadFile', data, {headers: {"Content-Type": "multipart/form-data;boundary=<calculated when request is sent>", "Authorization": store.state.token}})
}

